package com.xx.pmis.services.implementations;

import java.util.List;

import com.xx.pmis.model.HotelExpense;
import com.xx.pmis.persistence.dao.HotelExpenseDAO;
import com.xx.pmis.services.HotelExpenseService;

public class HotelExpenseServiceImpl implements HotelExpenseService {
	HotelExpenseDAO hotelExpenseDAO = null;

	public HotelExpenseServiceImpl(HotelExpenseDAO hotelExpenseDAO) {
		super();
		this.hotelExpenseDAO = hotelExpenseDAO;
	}

	public void saveOrUpdateHotelExpense(HotelExpense hotelExpense) throws Exception {
		hotelExpenseDAO.saveOrUpdate(hotelExpense);
	}

	public void saveHotelExpense(HotelExpense hotelExpense) throws Exception {
		hotelExpenseDAO.save(hotelExpense);
	}

	public void deleteHotelExpense(HotelExpense hotelExpense) throws Exception {
		hotelExpenseDAO.delete(hotelExpense);
	}

	public HotelExpense getHotelExpenseByHotelExpenseID(String HotelExpenseID) throws Exception {
		HotelExpense hotelExpense = hotelExpenseDAO.getHotelExpenseByHotelExpenseID(HotelExpenseID);
		return hotelExpense;
	}

	public List<HotelExpense> getAllHotelExpenseByCondition(String sql) throws Exception {
		List<HotelExpense> hotelExpenses = hotelExpenseDAO.getAllHotelExpenseByCondition(sql);
		return hotelExpenses;
	}

	public List<HotelExpense> getAllHotelExpenseByConditionByPage(String sql, int currentPage, int lineSize) throws Exception {
		List<HotelExpense> hotelExpenses = hotelExpenseDAO.getAllHotelExpenseByConditionByPage(sql, currentPage, lineSize);
		return hotelExpenses;
	}

	public int getCountOfHotelExpenseByCondition(String sql) throws Exception {
		return hotelExpenseDAO.getAllHotelExpenseByCondition(sql).size();
	}


}
